(function($, doc) {
	var search = $id('search')
	$.init({
		swipeBack: false
	});
	$('.mui-scroll-wrapper').scroll({
		bounce: false,
		indicators: false, //是否显示滚动条
		deceleration: mui.os.ios ? 0.003 : 0.0009
	});

	$.ready(function() {});

	$.plusReady(function() {
		
		$('.cateArea .mui-table-view').on('tap', '.mui-table-view-cell', function(e) {
			search.blur()
			if(!this.classList.contains('selected')){
				$('.cateArea .mui-table-view .mui-table-view-cell').each( function(){
					$removeClass(this,'selected')
				})
				$addClass(this,'selected')
			}
		})
		
		$('#locWrapper .mui-table-view-cell a').on('tap', '.show', function(e) {
			search.blur()
			$('#nurPopover').popover('show');
		})
		$('.mui-table-view-cell a').on('tap', '.nurfont', function(e) {
			search.blur()
			var isCheck = this.getAttribute('check');
			if(isCheck == 'none'){
				this.classList.remove('nur-check-none')
				this.classList.add('nur-check-all')
				this.setAttribute('check','all');
			}
			if(isCheck == 'part'){
				this.classList.remove('nur-check-part')
				this.classList.add('nur-check-none')
				this.setAttribute('check','none');
			}
			if(isCheck == 'all'){
				this.setAttribute('check','none');
				this.classList.remove('nur-check-all')
				this.classList.add('nur-check-none')
			}
		})
		
		$('#oneLoc .mui-table-view-cell').on('tap', 'a', function(e) {
			search.blur()
		})
		$('#nurPopover .foot').on('tap', 'button', function(e) {
			$('#nurPopover').popover('hide');
		})
	})
}(mui, document));
	
window.addEventListener('listenner', function(e) {
	if(e.detail.scan){
		mui('#scanPop').popover('toggle');
	}
	if(e.detail.dblTap){
		mui('#homeScrollWrapper').scroll().scrollTo(0, 0, 100);
	}
});
